<template>
  <div class="page-content"><h2>如何获取ticket</h2>
    <p>1、用户登录平台 <a :href="addr" target="_blank">{{ addr }}</a>
      （如果是测试对接，请参阅
      <a href="javascript:;" onclick="X.pub('switchPage', '2-1');return false;">【测试对接】</a>）
    </p>
    <p>2、找到对接实验课程，进入课程详情页面，点击【我要做实验】按钮，如下图所示：</p>
    <div class="img-ctn"><img src="../../images/docs/experimentDetail.png"></div>
    <p>3、会弹出具体实验课程的跳转URL，Ticket会以参数形式提供，附在跳转URL后面。</p>
    <p>链接组成样例：实验平台的URL?ticket=TICKET, 例如：{{ addr }}/shiyan/lidianchi?
      <span class="text-danger">ticket</span>=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJST05DT08iLCJleHAiOjE3MTM2NzEyNTksInVzZXJJZCI6IjE3MDE4MDgxNjk3OTMxMzg2OTAifQ.w570YvB8s0_AABT6ZzMS0YmfvBlgF5LAZV873uupPtU
    </p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      addr: ''
    }
  },
  mounted() {
    if (process.client) {
      // console.log(window.location.host, '获取地址栏域名1')
      // console.log(this.$route.fullPath, '获取地址栏参数2')
      // this.addr = window.location.protocol + '://' + window.location.hostname + ':8180/'
      this.addr = window.location.protocol + '//' + window.location.host
    }
  }
}
</script>
